//
//  DMSucceedVC.m
//  DistributionMall
//
//  Created by JHnoplan on 2018/10/14.
//  Copyright © 2018年 JHnoplan. All rights reserved.
//

#import "DMSucceedVC.h"

@interface DMSucceedVC ()

@property (weak, nonatomic) IBOutlet UIImageView *headImage;
@property (weak, nonatomic) IBOutlet UILabel *titleLb;
@property (weak, nonatomic) IBOutlet UIButton *bottomBt;



@end

@implementation DMSucceedVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self startInit];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"top_back"] style:UIBarButtonItemStyleDone target:self action:@selector(popAction)];
    self.navigationItem.leftBarButtonItem.tintColor = [UIColor whiteColor];
    
    
}

-(void)startInit {

    switch (_typeIndex) {
        case registerSucceed:
            self.navigationItem.title = @"注册成功";
            _titleLb.text = @"恭喜您，注册成功";
            [_bottomBt setTitle:@"返回登录" forState:UIControlStateNormal];
            break;
        case paySucceed:
            self.navigationItem.title = @"支付成功";
            _titleLb.text = @"恭喜您，支付成功";
            [_bottomBt setTitle:@"查看订单" forState:UIControlStateNormal];
            break;
        case tixianSucceed:
            self.navigationItem.title = @"提现成功";
            _titleLb.text = @"恭喜您，提现成功";
            [_bottomBt setTitle:@"确认返回" forState:UIControlStateNormal];
            break;
        case appraiseSucceed:
            self.navigationItem.title = @"评价成功";
            _titleLb.text = @"恭喜您，评价成功";
            [_bottomBt setTitle:@"确认返回" forState:UIControlStateNormal];
            break;
        case feedbackSucceed:
            self.navigationItem.title = @"反馈成功";
            _titleLb.text = @"恭喜您，反馈成功";
            [_bottomBt setTitle:@"确认返回" forState:UIControlStateNormal];
            break;
        default:
            break;
    }
}

- (IBAction)buttonClick:(UIButton *)sender {
    
    [self popAction];
}

-(void)popAction{
    
    
    switch (_typeIndex) {
        case registerSucceed:
            [self.navigationController popToRootViewControllerAnimated:YES];
            break;
        case paySucceed:
            [self.navigationController popToRootViewControllerAnimated:YES];
            break;
        case tixianSucceed:
            
            break;
        case appraiseSucceed:
            
            break;
        case feedbackSucceed:
            //pop回设置界面
            [self.navigationController popToViewController:self.navigationController.viewControllers[1] animated:YES];
            break;
        default:
            break;
    }
}


@end
